﻿//Ana Ibáñez
using System;

namespace Monkey
{
    class Intro
    {
        public void Lanzar()
        {
            Font sans18 = new Font("data/Joystix.ttf", 18);
            Image background = new Image("data/background.png");
            Sound musicaDeFondo = new Sound("data/intro.mid");
            musicaDeFondo.PlayMusicInLoop();
            do
            {
                Hardware.LimpiarPantalla();

                Hardware.DrawHiddenImage(background, 0, 0);

                Hardware.WriteHiddenText("Pulse ESPACIO para empezar",
                    235, 400,
                    0xCC, 0xCC, 0x00,
                    sans18);
                Hardware.WriteHiddenText("H - para la ayuda",
                    265, 440,
                    0xCC, 0xCC, 0x00,
                    sans18);
                Hardware.WriteHiddenText("C - para los créditos",
                    265, 480,
                    0xCC, 0xCC, 0x00,
                    sans18);
                Hardware.WriteHiddenText("Q - para salir",
                    265, 520,
                     0xCC, 0xCC, 0x00,
                    sans18);
                Hardware.ShowHiddenScreen();

                Hardware.Pause(20);

                if (Hardware.KeyPressed(Hardware.KEY_C))
                {
                    Credits creditsScreen = new Credits();
                    creditsScreen.Run();
                }

                if (Hardware.KeyPressed(Hardware.KEY_H))
                {
                    Help helpScreen = new Help();
                    helpScreen.Run();
                }

                if (Hardware.KeyPressed(Hardware.KEY_SPC))
                {
                    Partida miPartida = new Partida();
                    musicaDeFondo.StopMusic();
                    miPartida.Lanzar();
                }
            }
            while (!Hardware.KeyPressed(Hardware.KEY_Q));
        }
    }
}

